<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class CreateMedicalIllnesshistoryTable
 * 既往史数据库
 */
class CreateMedicalIllnesshistoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('st_medical_illnesshistory', function (Blueprint $table) {
            $table->increments('id')->comment("病历 既往史数据库");
            $table->unsignedInteger('record_id')->index()->comment("关联medical_records_id");
            $table->text('fat')->nullable()->comment("肥胖情况");
            $table->text('hypertension')->nullable()->comment("高血压情况");
            $table->text('coronary_disease')->nullable()->comment("冠心病情况");
            $table->text('hyperuricemia')->nullable()->comment("高尿酸血证情况");
            $table->text('hyperlipidemia')->nullable()->comment("高脂血症情况");
            $table->text('fatty_liver')->nullable()->comment("脂肪肝情况");
            $table->text('hepatitis')->nullable()->comment("肝炎情况");
            $table->text('pancreatitis')->nullable()->comment("胰腺炎史情况");
            $table->text('pancreatic_operation')->nullable()->comment("胰腺手术情况");
            $table->text('renal')->nullable()->comment("肾功能情况");
            $table->text('cerebral_infarction')->nullable()->comment("脑梗死情况");
            $table->text('pcos')->nullable()->comment("多囊卵巢综合征");
            $table->text('transfusion')->nullable()->comment("输血史情况");
            $table->text('irritability')->nullable()->comment("过敏史情况");
            $table->text('special_irritability')->nullable()->comment("特殊药物过敏史情况");
            $table->text('adverse_drug_reaction')->nullable()->comment("药物不良反应史情况");
            $table->text('thyroid')->nullable()->comment("甲亢、甲减情况");
            $table->text('other')->nullable()->comment("其他情况");
            $table->text('medication')->nullable()->comment("既往史用药情况");
            $table->text('operation')->nullable()->comment("手术史情况");
            $table->string('remark')->default('')->comment('备注');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('st_medical_illnesshistory');
    }
}
